home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Windows marzen / Macro ToolsWorks 6.31 / tworks.exe / Samples / Generate letter from information defined in form.mcr < prev    next >
Encoding:
Text File  |  2003-06-11  |  2.0 KB  |  59 lines

  1. <#> 
  2. <#> Sample: Start Notepad and generate cutomer's letter based on
  3. <#> what is selected in form.
  4. <#> 
  5. <cmds>
  6.  
  7. <#> Initialize and show form:
  8.  
  9. <form_item>("f1","Customer name:","EDIT","","vCustomerName")
  10. <form_item>("f1","Service:","LIST","UNIX Virtual Server|NT Virtual Server|UNIX Dedicated Server|NT Dedicated Server","vService")
  11. <form_item>("f1","Discount (in %):","LIST","0|5|10|20|30|50","vDiscount")
  12. <form_item>("f1","Support staff:","LIST","John McSmith|Adrian Mane|Brigita Largo","vStaff")
  13. <form_show>("f1","Customer Requests Information About Service","shell32.dll",0)
  14. <if_str>("_vCanceled == 1") <exitmacro> <endif>
  15.  
  16. <#> Start Notepad and make it active window
  17. <execappex>("notepad.exe","","",0,0)
  18. <waitfor>("WIN","OPEN","mw[[  ]] mc[[ Notepad ]] cw[[  ]] cc[[  ]] ",5,0)
  19. <actwin>("mw[[  ]] mc[[ Notepad ]] cw[[  ]] cc[[  ]] ",0,0,"no")
  20. <if_win>("mw[[  ]] mc[[ Notepad ]] cw[[  ]] cc[[  ]] ","ACT",0)
  21.  
  22. <if_str>("vService==UNIX Virtual Server")
  23.    <varset>("vPrice=99.95","")
  24. <endif>
  25. <if_str>("vService==NT Virtual Server")
  26.    <varset>("vPrice=79.95","")
  27. <endif>
  28. <if_str>("vService==UNIX Dedicated Server")
  29.    <varset>("vPrice=299.95","")
  30. <endif>
  31. <if_str>("vService==NT Dedicated Server")
  32.    <varset>("vPrice=259.95","")
  33. <endif>
  34.  
  35. <var_oper>(vDiscountedPrice,"%vPrice%-(%vPrice%*(%vDiscount%/100))",CALC_EXPRESSION,"2","", "0")
  36.  
  37. <#> Start writing letter here:
  38. <keys>Dear <varout>("vCustomerName",0),
  39.  
  40. thank you very much for contacting us concerning our
  41. web hosting services.  Find below some facts about
  42. the service you are interested in.  We are glad we can 
  43. offer you discounted price!
  44.  
  45. -------------------------------------------------------
  46. Customer: <varout>("vCustomerName",0)
  47. Service: <varout>("vService",0)
  48. Bandwith: Unlimited
  49. Price: <varout>("vPrice",0)/month
  50. Discount: <varout>("vDiscount",0)%
  51. Price after discount:<varout>("vDiscountedPrice",0)/month
  52. -------------------------------------------------------
  53.  
  54. Feel free to contact us with any question any time.
  55.  
  56.  
  57. <varout>("vStaff",0)
  58. The Service Company Support
  59.